package cn.zerlynn.sql.dialect.model;

/**
 * SQLColumn
 *
 * @author: zerlynn
 * @createTime: 2024/10/24 0:44
 */
public class SQLColumn {

    private final String name;
    private final String alias;
    // 数据类型
    private final String dataType;

    public SQLColumn(String name, String alias, String dataType) {
        this.name = name;
        this.alias = alias;
        this.dataType = dataType;
    }

    public String getName() {
        return name;
    }

    public String getAlias() {
        return alias;
    }

    public String getType() {
        return dataType;
    }

    public String getFullName() {
        return (alias != null && !alias.isEmpty()) ? name + " AS " + alias : name;
    }
}
